import urls from '../../url/auth.url';
import { axGet } from '@/lib/request';

export default {
  getUserInfoByToken() {
    /**
     *  根据token获取用户信息
     *  */
    const token = window.localStorage.getItem('token');
    return axGet(urls.getUserInfoByToken, {
      token,
    }).then(({ code, data }) => {
      return code === '1' ? data : {};
    });
  },
};
